
#import <UIKit/UIKit.h>
#import "ZallGlobal.h"

typedef enum : NSUInteger {
    KAutoScollViewCityWideType,
    KAutoScollViewTransoprtType,
} KAutoScollViewType;

@class ZallAutoScrollView;
@protocol ZallScrollViewAutoViewDelegate <NSObject>
@optional
/**
 *  @brief  响应委托协议，选中一个子视图时触发
 *
 *   无返回值
 */
- (void)autoScrollViewDelegate:(ZallAutoScrollView * _Nonnull)scrollView didSelectImageView:(NSInteger)index;

/**
 *  @brief  响应委托协议，滚动一个子视图时触发
 *
 *   无返回值
 */
- (void)autoScrollViewDelegate:(ZallAutoScrollView * _Nonnull)scrollView didScrollImageView:(NSInteger)index;
@end

/**
 *  @brief  使用的使用先初始化initWithFrame，否则可能视图height为0而展示不了，需要等到autoTimeInterval后展示
 */
@interface ZallAutoScrollView : UIView {
    __weak id<ZallScrollViewAutoViewDelegate>_delegate;
}
@property (strong, nonatomic, readonly, nonnull) UIScrollView *scrollView;
@property (strong, nonatomic, readonly, nonnull) UIPageControl *pageCtrl;

/**
 *  @brief  响应委托的对象
 */
@property (weak, nonatomic, nullable) id<ZallScrollViewAutoViewDelegate>delegate;

/**
 *  @brief  是否自动滚动, default NO
 */
@property (assign, nonatomic) BOOL autoScroll;

/**
 *  @brief  自动滚动的间隔, default 5.0f
 */
@property (assign, nonatomic) NSTimeInterval autoTimeInterval;

@property (copy, nonatomic, nonnull) NSString *imagePlaceholder;

/**
 *  @brief  图片链接数组，成员为NSString或者NSUrl 或者 UIImage
 */
@property (copy, nonatomic, nonnull) NSArray *imageUrls;

/**
 *  @brief  修改自动滑动视图的类型
 */
@property (assign, nonatomic) KAutoScollViewType type;

@end

